<?php
	$css_list[0]['url'][] = './tpl/css/zone.css';
	$js_list[0] = './tpl/js/zone.js';
?>
<!--{template inc/header}-->
<div id="body" class="fm960">
	<div class="homens_hd"></div>
	<div class="homens_bd clearfix">
		<div id="content" class="clearfix" style="width:960px;">
			<!--{template inc/u/u_menu}-->
			<div class="content fr" style="width:820px;">
				<div class="zone_head" style="margin:0 20px;">
					<div class="mb15">
						<h1 class="zone_title">我的佣金</h1>
						<a href="{u u/commission type=5}" style="font-size:20px;" class="zone_pub">我要提现</a>
					</div>
					<div> 
						<div class="zone_cat fl">
							<a href="{u u/commission}"{if $type == 0} class="c"{/if}>佣金列表</a>
							<!--{if $_FANWE['setting']['user_commission_type'] == 0}-->
							<span>|</span>
							<a href="{u u/commission type=1}"{if $type == 1} class="c"{/if}>已结算佣金</a>
							<!--{/if}-->
							<!--{if $_FANWE['setting']['user_commission_type'] == 0 || $_FANWE['setting']['user_commission_type'] == 1}-->
							<span>|</span>
							<a href="{u u/commission type=2}"{if $type == 2} class="c"{/if}>已支付佣金</a>
							<!--{/if}-->
							<span>|</span>
							<a href="{u u/commission type=3}"{if $type == 3} class="c"{/if}>资金日志</a>
							<span>|</span>
							<a href="{u u/commission type=4}"{if $type == 4} class="c"{/if}>提现日志</a>
							<span>|</span>
							<a href="{u user/commission}">佣金说明</a>
						</div>
					</div>
				</div>
				<!--{if $type == 3}-->
				<table class="list-table" border="0" cellpadding="0" cellspacing="0">
					<tbody>
						<tr class="lt-title">
							<th class="first" width="80">编号</th>
							<th width="80">增加</th>
							<th width="80">减少</th>
							<th>原因</th>
							<th class="last" width="130">发生时间</th>
						</tr>
						<!--{loop $order_list $order}-->
						<tr>
							<td class="lt-td first" style="text-align:center;vertical-align:middle;">{$order['id']}</td>
							<td class="lt-td tl" style="text-align:center;vertical-align:middle;">{if $order['money'] > 0}{$order['money']}{else}&nbsp;{/if}</td>
							<td class="lt-td" style="text-align:center;vertical-align:middle;">{if $order['money'] < 0}{$order['money']}{else}&nbsp;{/if}</td>
							<td class="lt-td">{$order['content']}</td>
							<td class="lt-td last tl" style="text-align:center;vertical-align:middle;">{$order['create_time']}</td>
						</tr>
						<!--{/loop}-->
					</tbody>
				</table>
				<!--{elseif $type == 4}-->
				<table class="list-table" border="0" cellpadding="0" cellspacing="0">
					<tbody>
						<tr class="lt-title">
							<th class="first" width="80">编号</th>
							<th>提现金额</th>
							<th>处理状态</th>
							<th>支付状态</th>
							<th width="130">支付/取消时间</th>
							<th class="last" width="130">申请时间</th>
						</tr>
						<!--{loop $order_list $order}-->
						<tr>
							<td class="lt-td first" style="text-align:center; vertical-align:middle;" rowspan="2">{$order['id']}</td>
							<td class="lt-td tl" style="text-align:center;">{$order['money_format']}</td>
							<td class="lt-td" style="text-align:center;">{if $order['status'] == 0}处理中{elseif $order['status'] == 1}已处理{else}作废{/if}</td>
							<td class="lt-td" style="text-align:center;">{if $order['pay_time'] > 0}{if $order['is_pay'] == 1}已支付{else}取消支付{/if}{else}未支付{/if}</td>
							<td class="lt-td" style="text-align:center;">{if $order['pay_time'] > 0}{$order['pay_time_format']}{/if}</td>
							<td class="lt-td last tl" style="text-align:center;">{$order['create_time']}</td>
						</tr>
						<tr>
							<td class="lt-td tl" colspan="3">备注：{$order['content']}</a></td>
							<td class="lt-td last tl" colspan="2">处理结果：{$order['adm']}</a></td>
						</tr>
						<!--{/loop}-->
					</tbody>
				</table>
				<!--{elseif $type == 5}-->
				<form action="{u u/commission}" method="post" id="commissionForm">
				<table class="list-table" border="0" cellpadding="0" cellspacing="0">
					<tbody>
						<tr>
							<td class="lt-td first" width="100" style="text-align:right;vertical-align:middle;">提现金额：</td>
							<td class="lt-td last">
								<input type="text" name="money" class="gray_text" style="line-height:20px; height:20px; padding:2px;" />&nbsp;
								（现有资金：¥{$_FANWE['user']['money']}）
							</td>
						</tr>
						<tr>
							<td class="lt-td first" width="100" style="text-align:right;" rowspan="2">备注：</td>
							<td class="lt-td last">
								<textarea name="content" class="gray_text" rows="5" cols="100" style="padding:3px;"></textarea>
							</td>
						</tr>
						<tr>
							<td class="lt-td last">
								请填定你的联系方式、转帐方式、相关银行或在线银行帐号，以便我们及时处理您提交的提现申请
							</td>
						</tr>
						<tr>
							<td class="lt-td first" width="100" style="text-align:right;">&nbsp;</td>
							<td class="lt-td last">
								<input type="submit" class="green_button" value="提交" style="border:none; padding:3px 10px;" />
								<input type="hidden" name="type" value="6" />
							</td>
						</tr>
					</tbody>
				</table>
				<script type="text/javascript">
				jQuery(function($){
					$("#commissionForm").submit(function(){
						var money = parseFloat(this.money.value);
						if(isNaN(money) || money < 0)
						{
							alert("请输入正确的提现金额");
							return false;	
						}
						this.money.value = money;
						if(money > {$_FANWE['user']['money']})
						{
							alert("提现金额超出现有资金");
							return false;	
						}
					});
				});
				</script>
				</form>
				<!--{else}-->
				<table class="list-table" border="0" cellpadding="0" cellspacing="0">
					<tbody>
						<tr class="lt-title">
							<th class="first" width="110">佣金编号</th>
							<th>佣金类型</th>
							<th>所得佣金</th>
							<th>支付状态</th>
							<th>支付/取消时间</th>
							<th width="80">结算时间</th>
							<th class="last" width="80">创建时间</th>
						</tr>
						<!--{loop $order_list $order}-->
						<tr>
							<td class="lt-td first" style="text-align:center; vertical-align:middle;" rowspan="2">o{$order['order_id']}</td>
							<td class="lt-td tl" style="text-align:center;">{if $order['type'] == 0}佣金返现{else}购买返现{/if}</td>
							<td class="lt-td" style="text-align:center;">{if $order['commission'] > 0}{$order['commission_format']}{else}<span style="color:#ccc;">获取中</span>{/if}</td>
							<td class="lt-td" style="text-align:center;">{if $order['pay_time'] > 0}{if $order['is_pay'] == 1}已支付{else}取消支付{/if}{else}未支付{/if}</td>
							<td class="lt-td" style="text-align:center;">{if $order['pay_time'] > 0}{$order['pay_time_format']}{/if}</td>
							<td class="lt-td" rowspan="2" style="text-align:center;vertical-align:middle;">{if $order['settlement_time'] > 0}{$order['settlement_time_format']}{/if}</td>
							<td class="lt-td last tl" style="text-align:center;vertical-align:middle;" rowspan="2">{$order['create_time']}</td>
						</tr>
						<tr>
							<td class="lt-td tl" colspan="4">商品：<a href="{$order['taoke_url']}" target="_blank">{cutstr $order['name'] 68}</a></td>
						</tr>
						<!--{/loop}-->
					</tbody>
				</table>
				<!--{/if}-->
				<div class="pagination pt15">
					<!--{subtemplate inc/pages}--> 
				</div>
			</div>
		</div>
	</div>
	<div class="homews_ft"></div>
</div>
<!--{template inc/footer}-->
